"""
File: login.py
Author: ershixiong
Date: 2023/12/25
describe:

"""

from hogwarts.WeworkApi.apis.wework import Wework


class Login(Wework):

    def login(self, data):
        url = 'gettoken'
        params = {
            'corpid': data.get('_corpid'),
            'corpsecret': data.get('_corpsecret')
        }

        pay_load = {
            'method': 'get',
            'url': url,
            'params': params
        }
        res = self.send(pay_load)
        return res
